<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<div id='liYunLong'>你真是个天才！</div>
<body>
</body>
</html>
<script type="text/javascript">
    var tools = {
        ele:[],
        $:function (id) {
            this.ele.push(document.getElementById(id))
            return this;
        },
        setColor: function (color) {
            for (var i = 0; i < this.ele.length; i++) {
                this.ele[i].style.color = color;
            }
            return this;
        },
        setFontSIze: function (fontsize) {
            for (var i = 0; i < this.ele.length; i++) {
                this.ele[i].style.fontSize = fontsize + 'px';
            }
            return this;
        },
        click:function (content) {
            for (var i = 0; i < this.ele.length; i++) {
                this.ele[i].onclick = function () {
                    alert(content)
                }
            }
            return this;
        }
    }
    tools.$('liYunLong').setColor('red').setFontSIze('50').click('弹出的信息内容');
</script>